# A plotting R script produced by the REVIGO server at http://revigo.irb.hr/ # If you found REVIGO useful in your work, please cite the following reference: # Supek F et al. "REVIGO summarizes and visualizes long lists of Gene Ontology # terms" PLoS ONE 2011. doi:10.1371/journal.pone.0021800 # -------------------------------------------------------------------------- # If you don't have the ggplot2 package installed, uncomment the following line: # install.packages ("ggplot2"); library (ggplot2); # -------------------------------------------------------------------------- # Here is your data from REVIGO. Scroll down for plot configuration options. revigo.names <- c("term_ID","description","frequency_%","plot_X","plot_Y","plot_size","log10_p_value","uniqueness","dispensability"); revigo.data <- rbind(c("GO:0000302","response to reactive oxygen species", 0.096, 6.317, 2.149, 4.039,-1.7453,0.922,0.000), c("GO:0001763","morphogenesis of a branching structure", 0.026,-1.890, 5.901, 3.470,-2.1633,0.927,0.000), c("GO:0006800","oxygen and reactive oxygen species metabolic process", 0.154,-4.736, 3.967, 4.210,-1.4576,0.976,0.000), c("GO:0007010","cytoskeleton organization", 0.203,-6.207,-4.519, 4.363,-4.2503,0.658,0.000), c("GO:0030029","actin filament-based process", 0.106,-2.339,-7.488, 4.084,-2.6234,0.947,0.019), c("GO:0048610","cellular process involved in reproduction", 0.190,-0.689,-0.357, 4.336,-1.2845,0.945,0.020), c("GO:0006006","glucose metabolic process", 1.107, 4.277,-5.634, 5.101,-3.6819,0.605,0.023), c("GO:0022402","cell cycle process", 0.220, 1.780, 5.824, 4.400,-1.0387,0.930,0.023), c("GO:0007017","microtubule-based process", 0.308,-6.258, 3.328, 4.546,-1.3821,0.944,0.024), c("GO:0006928","cellular component movement", 0.711, 0.286,-3.499, 4.908,-1.5852,0.942,0.026), c("GO:0019725","cellular homeostasis", 0.788,-6.872,-0.377, 4.953,-1.1086,0.763,0.026), c("GO:0042743","hydrogen peroxide metabolic process", 0.046,-2.932, 1.725, 3.718,-1.4830,0.932,0.040), c("GO:0015980","energy derivation by oxidation of organic compounds", 4.971, 3.352, 3.581, 5.753,-2.7472,0.864,0.065), c("GO:0006457","protein folding", 0.973, 3.798,-2.475, 5.045,-1.7912,0.907,0.067), c("GO:0006732","coenzyme metabolic process", 2.448,-2.114,-3.945, 5.445,-1.6226,0.913,0.073), c("GO:0051186","cofactor metabolic process", 3.543, 0.718, 1.738, 5.606,-1.2873,0.911,0.077), c("GO:0006091","generation of precursor metabolites and energy", 6.142, 3.610,-0.078, 5.845,-3.4698,0.907,0.085), c("GO:0006090","pyruvate metabolic process", 0.041, 1.294,-7.393, 3.667,-2.3547,0.826,0.227), c("GO:0006730","one-carbon metabolic process", 0.243, 0.879,-8.110, 4.442,-1.3359,0.806,0.265), c("GO:0043086","negative regulation of catalytic activity", 0.189,-7.236, 0.048, 4.334,-1.0046,0.846,0.289), c("GO:0009152","purine ribonucleotide biosynthetic process", 1.244, 2.630,-7.387, 5.151,-1.4429,0.666,0.314), c("GO:0006749","glutathione metabolic process", 0.072, 1.871,-7.272, 3.915,-1.1617,0.816,0.328), c("GO:0006911","phagocytosis, engulfment", 0.005,-5.656,-5.068, 2.743,-1.1661,0.774,0.394), c("GO:0043242","negative regulation of protein complex disassembly", 0.014,-6.542,-3.331, 3.218,-1.8178,0.675,0.423), c("GO:0044087","regulation of cellular component biogenesis", 0.077,-6.398,-2.711, 3.943,-1.2448,0.744,0.428), c("GO:0044042","glucan metabolic process", 0.249, 6.205,-3.116, 4.452,-1.0046,0.810,0.471), c("GO:0042692","muscle cell differentiation", 0.034,-2.394, 5.629, 3.589,-1.2050,0.892,0.511), c("GO:0048754","branching morphogenesis of a tube", 0.021,-2.502, 5.860, 3.372,-1.8178,0.918,0.537), c("GO:0032271","regulation of protein polymerization", 0.027,-6.576,-3.049, 3.489,-1.7442,0.635,0.555), c("GO:0016052","carbohydrate catabolic process", 1.399, 6.228,-3.566, 5.203,-2.2616,0.773,0.564), c("GO:0010035","response to inorganic substance", 0.247, 6.199, 1.876, 4.449,-1.4429,0.935,0.602), c("GO:0016051","carbohydrate biosynthetic process", 2.083, 5.805,-4.203, 5.375,-1.8697,0.754,0.608), c("GO:0030030","cell projection organization", 0.278,-6.028,-4.644, 4.500,-1.0460,0.688,0.635), c("GO:0000278","mitotic cell cycle", 0.103, 1.855, 6.005, 4.068,-1.0294,0.932,0.671), c("GO:0006119","oxidative phosphorylation", 0.910, 3.953, 3.924, 5.016,-1.1005,0.881,0.680)); one.data <- data.frame(revigo.data); names(one.data) <- revigo.names; one.data <- one.data [(one.data$plot_X != "null" & one.data$plot_Y != "null"), ]; one.data$plot_X <- as.numeric( as.character(one.data$plot_X) ); one.data$plot_Y <- as.numeric( as.character(one.data$plot_Y) ); one.data$plot_size <- as.numeric( as.character(one.data$plot_size) ); one.data$log10_p_value <- as.numeric( as.character(one.data$log10_p_value) ); one.data$frequency <- as.numeric( as.character(one.data$frequency) ); one.data$uniqueness <- as.numeric( as.character(one.data$uniqueness) ); one.data$dispensability <- as.numeric( as.character(one.data$dispensability) ); #head(one.data); # -------------------------------------------------------------------------- # Names of the axes, sizes of the numbers and letters, names of the columns, # etc. can be changed below p1 <- ggplot( data = one.data ); p1 <- p1 + geom_point( aes( plot_X, plot_Y, colour = log10_p_value, size = plot_size), alpha = I(0.6) ) + scale_area(); p1 <- p1 + scale_colour_gradientn( colours = c("blue", "green", "yellow", "red"), limits = c( min(one.data$log10_p_value), 0) ); p1 <- p1 + geom_point( aes(plot_X, plot_Y, size = plot_size), shape = 21, fill = "transparent", colour = I (alpha ("black", 0.6) )) + scale_area(); p1 <- p1 + scale_size( range=c(5, 30)) + theme_bw(); # + scale_fill_gradientn(colours = heat_hcl(7), limits = c(-300, 0) ); ex <- one.data [ one.data$dispensability < 0.15, ]; p1 <- p1 + geom_text( data = ex, aes(plot_X, plot_Y, label = description), colour = I(alpha("black", 0.85)), size = 3 ); p1 <- p1 + labs (y = "semantic space x", x = "semantic space y"); p1 <- p1 + opts(legend.key = theme_blank()) ; one.x_range = max(one.data$plot_X) - min(one.data$plot_X); one.y_range = max(one.data$plot_Y) - min(one.data$plot_Y); p1 <- p1 + xlim(min(one.data$plot_X)-one.x_range/10,max(one.data$plot_X)+one.x_range/10); p1 <- p1 + ylim(min(one.data$plot_Y)-one.y_range/10,max(one.data$plot_Y)+one.y_range/10); # -------------------------------------------------------------------------- # Output the plot to screen p1; # Uncomment the line below to also save the plot to a file. # The file type depends on the extension (default=pdf). # ggsave("C:/Users/path_to_your_file/revigo-plot.pdf");